cluster.name: {{ cluster_name }}
node.name: {{ node_name }}
node.master: {{ node_master }}
node.data: {{ node_data }}
node.ingest: {{ node_ingest }}
node.attr.box_type: {{ node_box_type }}

{% if node_zone is defined %}
node.attr.zone: {{ node_zone }}
{% endif %}

path.data: {{ data_path }}/elasticsearch/
path.logs: {{ logs_path }}/elasticsearch/

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

network.host: {{ ansible_host }}
http.port: 9200

{% set mhosts=[] %}
{%- if groups.elasticMaster -%}
{%- for host in groups.elasticMaster -%}
{{ mhosts.append(hostvars[host]['ansible_host']) }}
{%- endfor -%}
{%- elif groups.elasticsearch -%}
{%- for host in groups.elasticsearch -%}
{{ mhosts.append(hostvars[host]['ansible_host']) }}
{%- endfor -%}
{%- endif -%}

discovery.zen.ping.unicast.hosts: [{{ mhosts|join(',') }}]
discovery.zen.minimum_master_nodes: 2
http.cors.enabled: true
http.cors.allow-origin: "*"
